package com.kkwrite.regimen.provider.stream;

import org.springframework.cloud.stream.annotation.Input;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;

/**
 * Created by Ron on 2018/9/10 14:40.
 *
 * @author Ron
 */
public interface StreamInputAndOutput {

    String INCREASE_SALES_COUNT_IN_CHANNEL = "increaseSalesCountInput";
    String INCREASE_SALES_COUNT_OUT_CHANNEL = "increaseSalesCountOutput";
    String INCREASE_REVIEW_COUNT_IN_CHANNEL = "increaseReviewCountInput";
    String INCREASE_REVIEW_COUNT_OUT_CHANNEL = "increaseReviewCountOutput";
    String INCOME_RECORD_IN_CHANNEL = "incomeRecordInput";
    String INCOME_RECORD_OUT_CHANNEL = "incomeRecordOutput";
    String REWARD_POINTS_IN_CHANNEL = "reward-points-in";
    String REWARD_POINTS_OUT_CHANNEL = "reward-points-out";

    /**
     * 销量增长消息订阅
     *
     * @return SubscribableChannel
     */
    @Input(INCREASE_SALES_COUNT_IN_CHANNEL)
    SubscribableChannel increaseSalesCountInput();

    /**
     * 销量增长消息发布
     *
     * @return MessageChannel
     */
    @Output(INCREASE_SALES_COUNT_OUT_CHANNEL)
    MessageChannel increaseSalesCountOutput();

    /**
     * 评价数量增加消息订阅
     *
     * @return SubscribableChannel
     */
    @Input(INCREASE_REVIEW_COUNT_IN_CHANNEL)
    SubscribableChannel increaseReviewCountInput();

    /**
     * 评价数量增加消息发布
     *
     * @return MessageChannel
     */
    @Output(INCREASE_REVIEW_COUNT_OUT_CHANNEL)
    MessageChannel increaseReviewCountOutput();

    /**
     * 增加收益记录消息订阅
     *
     * @return SubscribableChannel
     */
    @Input(INCOME_RECORD_IN_CHANNEL)
    SubscribableChannel incomeRecordInput();

    /**
     * 增加收益记录消息发布
     *
     * @return MessageChannel
     */
    @Output(INCOME_RECORD_OUT_CHANNEL)
    MessageChannel incomeRecordOutput();

    /**
     * 奖励积分消息订阅
     *
     * @return SubscribableChannel
     */
    @Input(REWARD_POINTS_IN_CHANNEL)
    SubscribableChannel rewardPointInput();

    /**
     * 奖励积分消息发布
     *
     * @return MessageChannel
     */
    @Output(REWARD_POINTS_OUT_CHANNEL)
    MessageChannel rewardPointOutput();
}
